package Day13;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * Creat with IntelliJ IDEA
 * Description
 * User: mamba24
 * Date: 2022-09-25
 * Time: 20:50
 * To BE A Better Person-2020-3-2
 */
public class TestDemo1 {
    public static void main(String[] args) {
        ArrayList<String> arrayList=new ArrayList<>();
        Scanner sc=new Scanner(System.in);
        String s=sc.nextLine();
        int beg=0;
        int i = 0;
        //处理字符串
        for (; i < s.length(); i++) {
            if(s.charAt(i)==' '){
                arrayList.add(s.substring(beg,i));
                beg=i+1;
            }
            if(s.charAt(i) == '"'){
                arrayList.add(s.substring(beg,i));
                int index=i+1;
                while(s.charAt(index) != '"'){
                    index++;
                }
                arrayList.add(s.substring(i+1,index));
                beg=index;
                i=index;
            }
        }
        arrayList.add(s.substring(beg,i));
        //计算长度
        System.out.println(arrayList.size());
        //遍历输出字符串
        for (i = 0; i < arrayList.size(); i++) {
            System.out.println(arrayList.get(i));
        }

    }
}
